import policy from "@/router/modules/policy";
import request from "@/utils/request";

//获得策略列表
export function getpolicylist(pageIndex,pageSize,policyName) { 
  return request({
    url: 'vm-service/policy/search',
    method: 'get',
    params: {
      pageIndex,pageSize,policyName
    },
    contentType : "application/x-www-form-urlencoded; charset=utf-8"
  })
}
//新增
export function addpolicy(data) { 
  return request({
    url: 'vm-service/policy',
    method: 'post',
    data
  })
}
//修改
export function changePolicy(data) { 
  return request({
    url: `vm-service/policy/${data.policyId}`,
    method: 'put',
    data,
  })
}
//详情
export function getpolicydetail(pageIndex,pageSize,policyId) { 
  return request({
    url: `vm-service/policy/vmList/${policyId}`,
    method: 'get',
    params: {
      pageIndex,pageSize
    }
  })
}
//删除:policyId
export function delpolicy(policyId) { 
  return request({
    url: `vm-service/policy/${policyId}`,
    method: 'delete'
  })
}
